<template>
  <div>
    <div class="load" v-show="loading"></div>
    <div v-show="!loading">
      <div v-show="hasData">没有数据了~</div>
      <button @click="handleMore" v-show="!hasData">加载更多</button>
    </div>
  </div>
</template>

<script>
export default {
  props: ["loading", "hasData"],
  methods: {
    handleMore() {
      this.$emit("more");
    }
  }
};
</script>

<style lang="less" scoped>
.load {
  height: 30px;
  width: 30px;
  margin: 0 auto;
  border: 4px solid #666;
  border-radius: 50%;
  border-top-color: transparent;
  border-left-color: transparent;
  animation: loading 1s ease-in-out infinite;
}
@keyframes loading {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}
</style>